package com.yy.tech.data.app.rest;


import com.yy.tech.data.annotation.SecretParam;
import com.yy.tech.data.app.domain.ExampleRequest;
import com.yy.tech.data.app.domain.ExampleResponse;
import com.yy.tech.data.app.service.ExampleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("demo")
public class DesensitizedRestful {
    @Autowired
    private ExampleService service;

    @PostMapping("bean")
    public ExampleResponse doHandleBean(@RequestBody ExampleRequest request){
        return service.doHandle(request);
    }

    @PostMapping("map")
    public Map<String, Object> doHandleMap(@RequestBody Map<String,Object> request){
        return service.doHandle(request);
    }

    @PostMapping("para/{idNumber}")
    public ExampleResponse doHandlePara(@SecretParam @PathVariable String idNumber){
        return service.doHandle(idNumber);
    }
}
